package borders;

import squares.Square;
import be.kuleuven.cs.som.annotate.*;
/**
 * a wall is a special case of border, it contains a extra variable,
 * namely if the wall is slippery or not.
 * @Invar each Border can have his first attached square as an attached square. (inherited from the class parent)
 * 			| Border.isValidAttachedSquare(Border.getAttachedSquare1())
 * @Invar each Border can have his second attached square as an attached square. (inherited from the class parent)
 * 			| Border.isValidAttachedSquare(Border.getAttachedSquare2())
 * @version 1.0
 * @author Gilles Groven & Jochen Tombal
 *
 */
public class Wall extends Border {
	
	private boolean SlipperyWall;
	/**
	 * initializes this wall with the given square as attached border and the given slippery
	 * @param square1
	 * 		the first square this wall is attached to.
	 * @param slippery
	 * 		the slippery of the wall
	 * @effect the new Wall is initialized as a new border with the given square as attached square
	 * 			|super(square1)
	 * @post the given slippery is equal to the slippery of this wall
	 * 		| new.getSlipperyOfWall() == slippery;		
	 */
	@Raw
	public Wall(Square square1,boolean slippery)
	{
		super(square1);
		setSlipperyOfWall(slippery);
		
	}
	/**
	 * initializes this wall with the given squares as attached borders and the given slippery
	 * @param square1
	 * 		the first square this wall is attached to.
	 * @param square2
	 * 		the second square this wall is attached to.
	 * @param slippery
	 * 		the slippery of the wall
	 * @effect the new wall is initialized as a new border with the given squares as attached squares
	 * 			and only one square attached if the attached squares are the same.
	 * 			|super(square1,square2)
	 * @post the given slippery is equal to the given slippery
	 * 		| new.getSlipperyOfWall() == slippery;
	 */
	@Raw
	public Wall (Square square1,Square square2, boolean slippery)
	{
		super(square1,square2);
		setSlipperyOfWall(slippery);
	}
	/**
	 * initializes the wall with a standard value for the border attached squares and no slippery
	 * @post the wall is not slippery.
	 * 		| getSlipperyOfWall() == false;
	 */
	@Raw
	public Wall()
	{
		setSlipperyOfWall(false);
	}
	/**
	 * sets the slippery of the wall.
	 * @param slippery
	 * 		the new slippery of this wall.
	 * @post the given slippery is equal to the slippery of the wall.
	 * 		| new.getSlipperyOfWall() == slippery;
	 */
	@Raw
	@Basic
	private void setSlipperyOfWall(boolean slippery)
	{
		this.SlipperyWall = slippery;
	}
	/**
	 * @return
	 * 		the slippery of this wall
	 */
	@Basic
	public boolean getSlipperyOfWall()
	{
		return this.SlipperyWall;
	}

}
